package com.zhouxiaoge.abstractfactorypattern.factory;

import com.zhouxiaoge.abstractfactorypattern.interfaces.Color;
import com.zhouxiaoge.abstractfactorypattern.interfaces.Shape;
import com.zhouxiaoge.abstractfactorypattern.interfacesImpl.Circle;
import com.zhouxiaoge.abstractfactorypattern.interfacesImpl.Rectangle;
import com.zhouxiaoge.abstractfactorypattern.interfacesImpl.Square;

public class ShapeFactory extends AbstractFactory {


    @Override
    public Color getColoor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shapeType) {
        if (shapeType == null) {
            return null;
        }
        if (shapeType.equalsIgnoreCase("CIRCLE")) {
            return new Circle();
        } else if (shapeType.equalsIgnoreCase("RECTANGLE")) {
            return new Rectangle();
        } else if (shapeType.equalsIgnoreCase("SQUARE")) {
            return new Square();
        }
        return null;
    }
}
